package calculate;

/**
 * This interface defines the binary operator.
 * 
 * @author Jacky Xu
 *
 */

public interface BinaryOperator {

	/**
	 * The method is to implement the abstract binary operation.
	 * 
	 * @param a: operand 1
	 * @param b: operand 2
	 * @return the result of a op b
	 */
	public double calculate(double a, double b);

	/**
	 * Static factory method. Return an instance of class Add
	 * 
	 * @return an instance of Add
	 */
	public static BinaryOperator RetAdd() {
		return new Add();
	}

	/**
	 * Static factory method. Return an instance of class Minus
	 * 
	 * @return an instance of Minus
	 */
	public static BinaryOperator RetMinus() {
		return new Minus();
	}

	/**
	 * Static factory method. Return an instance of class Multiply
	 * 
	 * @return an instance of Multiply
	 */
	public static BinaryOperator RetMultiply() {
		return new Multiply();
	}

	/**
	 * Static factory method. Return an instance of class Division
	 * 
	 * @return an instance of Division
	 */
	public static BinaryOperator Division() {
		return new Division();
	}

}
